#include <stdio.h>
#include <string.h>
char ReverseOrder(char *str)
{
    int length = strlen(str);
    int pos =0;
    
    for (int i=length-1; i >pos; i--)
    {
        
        char tmp=str[i];
        str[i]=str[pos];
        str[pos]=tmp;
        pos++;
    }    
    
}

void fun(char *str)
{
    char *start=str;
    char *end=str+1;
    while(*end!=' ')
    {
        end=end+1;
    }
    char *next=end+1;
    *end='\0';
    ReverseOrder(start);
    ReverseOrder(next);
    *end= ' ';
    
}
int main()
{
    char arr[100] = "hello world ";

    ReverseOrder(arr);
    fun(arr);
    ReverseOrder(arr);
    printf("%s\n",arr);
    return 0;
}